@extends('admin_system/public/layout')
@section('content')
    <div class="col-xs-12 top-nav nav">
        <p class="float-left nav-path"><strong>当前位置：</strong>分会管理>>添加、编辑分会</p>

        {{--返回按钮--}}
        <button type="button" class="btn btn-default float-right back" aria-label="Left Align">
            <span class="glyphicon glyphicon-arrow-left back" aria-hidden="true"></span>
            <span>返回</span>
        </button>
    </div>

    <div class="col-xs-12"></div>

    <div class="content-box col-xs-12 mt20 pb20 pt20">
        <form class="col-xs-4" style="min-width: 300px;" action="{{asset('/admin_system/chapter/chapterEditAction')}}" method="post" enctype="multipart/form-data">

            <input type="hidden" name="chapter_id" value="{{$chapter->chapter_id}}">
            {{ csrf_field() }}
            <div class="form-group">
                <label>分会名称：</label>
                <input name="chapter_name" class="form-control" value="{{$chapter->chapter_name}}" required>
            </div>



            {{--<div class="form-group">--}}
                {{--<label>总金额：</label>--}}
                {{--<input name="total_money" class="form-control" value="{{$chapter->total_money}}" required>--}}
            {{--</div>--}}

            {{--<div class="form-group">--}}
                {{--<label>支付金额：</label>--}}
                {{--<input name="payed_money" class="form-control" value="{{$chapter->payed_money}}" required>--}}
            {{--</div>--}}


            <div class="form-group">
                <label>分会城市：</label>
                <select name="province" class="form-control" onchange="get_cities()" id="province">
                    <option value="">选择省份</option>
                    @foreach($provinces as $province)
                        @if($province->region_id == $chapter->province)
                            <option value="{{$province->region_id}}" selected>{{$province->region_name}}</option>
                        @else
                            <option value="{{$province->region_id}}">{{$province->region_name}}</option>
                        @endif
                    @endforeach
                </select>

                <select name="city" class="form-control" id="city">
                    <option value="">选择城市</option>
                    @foreach($cities as $city)
                        @if($city->region_id == $chapter->city)
                            <option value="{{$city->region_id}}" selected>{{$city->region_name}}</option>
                        @else
                            <option value="{{$city->region_id}}">{{$city->region_name}}</option>
                        @endif
                    @endforeach
                </select>
            </div>

            
            <button type="submit" class="btn btn-primary">提交</button>
        </form>
    </div>

@endsection
